import './editor.less';

import React, { Component } from 'react';

import { SetItem, SetGrid } from '../../h5ds-components/item';

const icon = <i className="h5ds-ico h5ds-ico-xingzhuang" />;

/**
 * props: h5ds, scope, layer
 */
class Editor extends Component {
  constructor(props) {
    console.log(props);
    super(props);
  }

  changeText = e => {
    this.props.layer.data.text = 'hello';
    this.props.layer.data.color = '#333';
    this.props.h5ds.updateCanvas();
  }
  render() {
    return (
      <div className="editor-dt-button">
        <SetItem name="按钮：">
          <button onClick={this.changeText}>修改按钮名字</button>
        </SetItem>
        <SetGrid>
          <div className="grid">整个区域进行渲染</div>
        </SetGrid>
      </div>
    );
  }
}

export { Editor, icon };
